package com.sneakxy.mybatis.commons.repository.support.transformer;

import java.util.Optional;

import org.springframework.data.domain.ExampleMatcher;

/**
 * @author 潜行的青衣
 */
public class ContainingPropertyValueTransformer implements ExampleMatcher.PropertyValueTransformer {

	/* (non-Javadoc)
	 * @see java.util.function.Function#apply(java.lang.Object)
	 */
	@Override
	public Optional<Object> apply(Optional<Object> source) {
		return Optional.of(new StringBuilder().append("%").append(source.get()).append("%").toString());
	}

}
